class Grammar {
  OptionsSection optionsSection;
  RulesSection rulesSection;
  FreeTextSection freeTextSection;
}

class OptionsSection {
  final List<Option> options = [];
  final List<DartCode> dartCode = [];
  final List<Alias> aliases = [];
}

class RulesSection {
  final List<Rule> rules = [];
}

class FreeTextSection {
  String text = '';
}

class Option {
  final List<OptionValue> values = [];
  String name;
  String typeAttr;
}

class OptionValue {
  String reference;
  DartCode dartCode;
  String string;
}

class Alias {
  String name;
  RegExp regExp;
}

class Rule {
  final List<Alternative> alternatives = [];
  RegExp regExp;
  String string;
  String reference;
  String eof;
  DartCode dartCode;
}

class Alternative {
  final List<RuleReference> references = [];
  DartCode dartCode;
}

class RuleReference {
  String string;
  String reference;
}

class DartCode {
  String text = '';
}
